import HomeView from '@/views/HomePage.vue'
import UserLoginPage from '@/views/user/UserLoginPage.vue'
import UserRegisterPage from '@/views/user/UserRegisterPage.vue'
import AdminManagerPage from '@/views/admin/UserManagePage.vue'
import UserInfoPage from '@/views/user/UserInfoPage.vue'
import { HomeOutlined } from '@ant-design/icons-vue'
import { h } from 'vue'
import { ACCESS_ENUM } from '@/router/role.ts'
import AddPicturePage from '@/views/picture/AddPicturePage.vue'
import PictureManagerPage from '@/views/admin/PictureManagePage.vue'
import PictureDetailPage from '@/views/picture/PictureDetailPage.vue'
import AddPictureBatchPage from '@/views/picture/AddPictureBatchPage.vue'
import SpaceManagePage from '@/views/admin/SpaceManagePage.vue'
import AddSpacePage from '@/views/space/AddSpacePage.vue'
import MySpacePage from '@/views/space/MySpacePage.vue'
import SpaceDetailPage from '@/views/space/SpaceDetailPage.vue'
import SpaceAnalyzePage from '@/views/space/SpaceAnalyzePage.vue'

const routes = [
  {
    path: '/',
    name: '主页',
    component: HomeView,
    meta: {
      icon: () => h(HomeOutlined),
    }
  },
  {
    path: '/user/login',
    name: '用户登录',
    component: UserLoginPage,
    meta: {
      show: false,
    },
  },
  {
    path: '/user/register',
    name: '用户注册',
    component: UserRegisterPage,
    meta: {
      show: false,
    },
  },
  {
    path: '/admin/manager',
    name: '用户管理',
    component: AdminManagerPage,
    meta: {
      authCheck: ACCESS_ENUM.ADMIN
    }
  },
  {
    path: '/user/info',
    name: "个人信息",
    component: UserInfoPage,
    meta: {
      show: false,
      authCheck: ACCESS_ENUM.USER
    }
  },
  {
    path: '/add_picture',
    name: '创建图片',
    component: AddPicturePage,
    meta: {
      authCheck: ACCESS_ENUM.USER
    }
  },
  {
    path: '/admin/pictureManage',
    name: '图片管理',
    component: PictureManagerPage,
    meta: {
      authCheck: ACCESS_ENUM.ADMIN
    }
  },
  {
    path: '/picture/:id',
    name: '图片详情',
    component: PictureDetailPage,
    meta: {
      show: false,
    }
  },
  {
    path: '/add_picture/batch',
    name: '批量创建图片',
    component: AddPictureBatchPage,
    meta: {
      show: false,
      authCheck: ACCESS_ENUM.ADMIN
    }
  },
  {
    path: '/admin/spaceManage',
    name: '空间管理',
    component: SpaceManagePage,
    meta: {
      authCheck: ACCESS_ENUM.ADMIN
    }
  },
  {
    path: '/add_space',
    name: '创建空间',
    component: AddSpacePage,
    meta: {
      show: false,
      authCheck: ACCESS_ENUM.USER
    }
  },
  {
    path: '/my_space',
    name: '我的空间',
    component: MySpacePage,
    meta: {
      show: false,
      authCheck: ACCESS_ENUM.NOT_LOGIN
    }
  },
  {
    path: '/space/:id',
    name: '空间详情',
    component: SpaceDetailPage,
    meta: {
      show: false,
      authCheck: ACCESS_ENUM.USER
    }
  },
  {
    path: '/space_analyze',
    name: '空间分析',
    component: SpaceAnalyzePage,
    meta: {
      show: false,
      authCheck: ACCESS_ENUM.USER
    }
  }
]
export { routes };
